home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / Obrn-A_1.6_lib.lha / oberon-a / source3.lha / source / 3rdParty / TextFieldGadget.mod < prev    next >
Text File  |  1995-05-23  |  3KB  |  133 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: TextFieldGadget.mod $
  4.   Description: Interface to triton.library
  5.  
  6.    Created by: Helmuth Ritzer
  7.     $Revision: 2.0 $
  8.       $Author: hr $
  9.         $Date: 1995/01/21 16:15:40 $
  10.  
  11.   Copyright © 1994 Mark Thomas
  12.   Translated for Oberon-A by Helmuth Ritzer, June 1994
  13.   Minor modifications for Oberon-A Release 1.4 by Frank Copeland.
  14.   Adapted to V2.0 by Helmuth Ritzer, Jan 1995
  15.  
  16. ***************************************************************************)
  17.  
  18. <* STANDARD- *>
  19.  
  20. MODULE [2] TextFieldGadget;
  21.  
  22. IMPORT SYS := SYSTEM, Kernel, E := Exec, I := Intuition, U := Utility;
  23.  
  24.  
  25. CONST
  26.   tagBase           = U.user + 04000000H;
  27.  
  28.   (* V1.0 *)
  29.   text *          = tagBase + 1;
  30.   insertText *    = tagBase + 2;
  31.   textFont *      = tagBase + 3;
  32.   delimiters *    = tagBase + 4;
  33.   top *           = tagBase + 5;
  34.   blockCursor *   = tagBase + 6;
  35.   size *          = tagBase + 7;
  36.   visible *       = tagBase + 8;
  37.   lines *         = tagBase + 9;
  38.   noGhost *       = tagBase + 10;
  39.   maxSize *       = tagBase + 11;
  40.   border *        = tagBase + 12;
  41.   textAttr *      = tagBase + 13;
  42.   fontStyle *     = tagBase + 14;
  43.   up *            = tagBase + 15;
  44.   down *          = tagBase + 16;
  45.   alignment *     = tagBase + 17;
  46.   vCenter *       = tagBase + 18;
  47.   ruledPaper *    = tagBase + 19;
  48.   paperPen *      = tagBase + 20;
  49.   inkPen *        = tagBase + 21;
  50.   linePen *       = tagBase + 22;
  51.   userAlign *     = tagBase + 23;
  52.   spacing *       = tagBase + 24;
  53.   clipStream *    = tagBase + 25;
  54.   clipStream2 *   = tagBase + 26;
  55.   blinkRate *     = tagBase + 27;
  56.   inverted *      = tagBase + 28;
  57.   partial *       = tagBase + 29;
  58.   cursorPos *     = tagBase + 30;
  59.  
  60.   (* V2.0 *)
  61.   readOnly *      = tagBase + 31;
  62.   modified *      = tagBase + 32;
  63.   acceptChars *   = tagBase + 33;
  64.   rejectChars *   = tagBase + 34;
  65.   passCommand *   = tagBase + 35;
  66.   lineLength *    = tagBase + 36;
  67.   maxSizeBeep *   = tagBase + 37;
  68.   deleteText *    = tagBase + 38;
  69.   selectSize *    = tagBase + 39;
  70.   copy *          = tagBase + 40;
  71.   copyAll *       = tagBase + 41;
  72.   cut *           = tagBase + 42;
  73.   paste *         = tagBase + 43;
  74.   erase *         = tagBase + 44;
  75.   undo  *         = tagBase + 45;
  76.  
  77. (*
  78.  * TEXTFIELD_Border
  79.  *
  80.  * See docs for width and height sizes these borders are
  81.  *)
  82.  
  83.   borderNone *        = 0;
  84.   borderBevel *       = 1;
  85.   borderDoubleBevel * = 2;
  86.  
  87. (*
  88.  * TEXTFIELD_Alignment
  89.  *)
  90.  
  91.   alignLeft *         = 0;
  92.   alignCenter *       = 1;
  93.   alignRight *        = 2;
  94.  
  95.  
  96. TYPE
  97.   TextFieldBasePtr * = POINTER TO TextFieldBase;
  98.   TextFieldBase * = RECORD (E.Library) END;
  99.  
  100. CONST
  101.   name * = "gadgets/textfield.gadget";
  102.  
  103.  
  104. VAR
  105.   base * : TextFieldBasePtr;
  106.   textFieldClass * : I.IClassPtr; (* Use this for NewObject() calls *)
  107.  
  108. PROCEDURE GetClass* [base,-30] ()
  109.   : I.IClassPtr;
  110.  
  111. (*-- Library Base variable --------------------------------------------*)
  112.  
  113. <*$LongVars-*>
  114.  
  115. PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
  116.   BEGIN
  117.     IF base # NIL THEN E.CloseLibrary (base) END;
  118.   END CloseLib;
  119.  
  120. PROCEDURE [0] OpenLib * (mustOpen : BOOLEAN);
  121.   BEGIN
  122.     IF base = NIL THEN
  123.       base := SYS.VAL(TextFieldBasePtr, E.OpenLibrary (name, 0));
  124.       IF base # NIL THEN Kernel.SetCleanup (CloseLib); textFieldClass := GetClass();
  125.       ELSIF mustOpen THEN HALT (100)
  126.       END
  127.     END
  128.   END OpenLib;
  129.  
  130. BEGIN
  131.   base := NIL; textFieldClass := NIL;
  132. END TextFieldGadget.
  133.